1

00:00:00,294  -->  00:00:08,688
In this video, we will still learning about
paramiko. Now we will modify the input script.

2

00:00:09,417  -->  00:00:20,016
Here I will add or parameter, so
let’s say or and then 10.10.10.1.

3

00:00:20,821  -->  00:00:30,765
In the user, let’s add or cisco, in the
getpass, we also able to add or parameter,

4

00:00:31,309  -->  00:00:34,300
so here or cisco.

5

00:00:35,011  -->  00:00:39,903
this or parameter is used
to define the default value.

6

00:00:40,628  -->  00:00:45,099
When we run the script, we need
to input the ip address right?

7

00:00:45,745  -->  00:00:56,525
But because now we have or parameter, we can
just enter, and the value will be 10.10.10.1

8

00:00:57,301  -->  00:01:01,666
Let’s try it, go to python interpreter.

9

00:01:04,796  -->  00:01:10,023
Here, ip_address input ip address,

10

00:01:15,654  -->  00:01:17,736
let’s just enter here,

11

00:01:18,672  -->  00:01:21,178
Now let’s print ip_address,

12

00:01:24,392  -->  00:01:27,885
Here we can see that the ip_address is empty.

13

00:01:28,741  -->  00:01:45,707
Now let’s try to use or, so here
ip_address input, ip address or 10.10.10.1,

14

00:01:48,156  -->  00:01:50,245
Let’s just enter here,

15

00:01:50,945  -->  00:02:02,179
Print the ip address, here we can
see that the value is 10.10.10.1.

16

00:02:02,865  -->  00:02:11,820
Okay, so remember that or parameter in input
like this is used to define the default value.

17

00:02:12,545  -->  00:02:20,521
But if we type the ip address in the input,
the default value will not used. Let’s try,

18

00:02:21,000  -->  00:02:37,456
ip_address input ip address or
10.10.10.1, enter, let’s input 10.10.10.2,

19

00:02:38,807  -->  00:02:40,612
print the ip address,

20

00:02:42,079  -->  00:02:51,528
okay here we can see that the value is
10.10.10.2, so the default value is not used.

21

00:02:56,501  -->  00:03:01,008
Let’s save the script, let’s
also change the loopback,

22

00:03:01,505  -->  00:03:10,946
let’s say here we will create loopback2,
the ip address is 10.1.1.3, save.

23

00:03:13,072  -->  00:03:23,233
Let’s run the script again,
python3 paramiko_basic.py,

24

00:03:23,778  -->  00:03:26,154
Just enter enter here.

25

00:03:27,861  -->  00:03:34,706
Here we can see that we are success
login to router 1, and create loopback2,

26

00:03:36,000  -->  00:03:51,000
Let’s check on router 1, do show ip interface brief
and then here I add argument exclude unassign,

27

00:03:53,596  -->  00:03:56,706
this is means that we see the interface,

28

00:03:57,265  -->  00:04:03,426
but if there is a word unassign,
so that is will not shown.

29

00:04:04,501  -->  00:04:08,354
Here we can see that we get a lot of interface,

30

00:04:08,857  -->  00:04:15,565
but we don’t need an interface that
unassign, so we can exclude it.

31

00:04:17,941  -->  00:04:25,758
Here the result is only interface that have
an ip address. And here we can see loopback2,

32

00:04:26,410  -->  00:04:33,895
Okay I think enough for this video, I
hope you understand the function of or in input.

33

00:04:34,442  -->  00:04:38,156
Thank you for watching and see you on the next video.
